package com.luch.respository;

import com.luch.domain.User;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Example;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Creator lh on 2017/8/15 10:02.
 * Email:luchefg@gmail.com
 * Description:
 */
@CacheConfig(cacheNames = "user")
public interface UserRespository extends JpaRepository<User,Integer>{

    @Cacheable
    List<User> findAllByName(String name);

    /*@Query("select luch from user where name = ?1")
    long findAllByName(String name,String password);*/
}
